package com.grep.extra.factory.data.impl;

import java.util.HashMap;
import java.util.Map;

import com.grep.extra.factory.data.IContent;

public class Content implements IContent {
	
	private Map<String ,String > valueMap = new HashMap<String ,String >() ;
	
	private String sql = null ;

	public String getSql() {
		return sql;
	}

	public void setSql(String sql) {
		if(sql!=null){
			for(String key :valueMap.keySet()){
				if(valueMap.get(key)!=null){
					sql = sql.replaceAll("<"+key+">","'" + valueMap.get(key)+"'") ;
				}else{
					sql = sql.replaceAll("<"+key+">", valueMap.get(key)+"") ;
				}
			}
		}
		this.sql = sql;
	}

	public Map<String, String> getValueMap() {
		return valueMap;
	}

	public void setValueMap(Map<String, String> valueMap) {
		this.valueMap = valueMap;
	}
	

}
